There is a problem when I select a line in mysql table and afet I
delete it.
1/ It works :=20
$sql =3D 'SELECT * FROM table WHERE id=3D"10" ';
$req =3D mysql_query($sql) or die('Erreur SQL
! '.$sql.' '.mysql_error());=20
while($data =3D mysql_fetch_assoc($req)) {
echo $data['id'];
}
$sql2 =3D 'DELETE FROM table WHERE id=3D"10" ';
$req2 =3D mysql_query($sql2) or die('Erreur SQL
! '.$sql2.' '.mysql_error());
2/ It don't work :=20
$sql =3D 'SELECT * FROM table WHERE id=3D"'.$var.'" ';
$req =3D mysql_query($sql) or die('Erreur SQL
! '.$sql.' '.mysql_error());=20
while($data =3D mysql_fetch_assoc($req)) {
echo $data['id'];
}
$sql2 =3D 'DELETE FROM table WHERE id=3D"'.$var.'" ';
$req2 =3D mysql_query($sql2) or die('Erreur SQL
! '.$sql2.' '.mysql_error());
Results of this queries :=20
In first case (it works) : I see the id get in mysql and it delete it
after
In second case (it don't work) : I don't see id get in mysql. It's like
if it delete it first and after select.
I have not error in php log.
If somebody can help me, because I try since few hours...
Best regards,
David DURIEUX
Tel : +33 (0)4.74.04.81.34
Port : +33 (0)6.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 11:13:11 von Evert Lammerts
> $sql = 'SELECT * FROM table WHERE id="'.$var.'" ';
> $req = mysql_query($sql) or die('Erreur SQL
> ! '.$sql.' '.mysql_error());
> while($data = mysql_fetch_assoc($req)) {
> echo $data['id'];
> }
> $sql2 = 'DELETE FROM table WHERE id="'.$var.'" ';
> $req2 = mysql_query($sql2) or die('Erreur SQL
> ! '.$sql2.' '.mysql_error());
I'll ask the obvious: where and how is $var set, and did you echo your
$sql variable to try the query on your mysql server directly?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 11:17:51 von Kendo Tom
Hi ,
For this situation , you should print out the SQL statement to check
the value of the variable "$var" .
--------------------------------------------------
From: "David DURIEUX"
Sent: Wednesday, September 03, 2008 5:07 PM
To:
Subject: [PHP-DB] Probleme with MySQL queries
> Hello
>
> There is a problem when I select a line in mysql table and afet I
> delete it.
>
>
> 1/ It works :
> $sql = 'SELECT * FROM table WHERE id="10" ';
> $req = mysql_query($sql) or die('Erreur SQL
> ! '.$sql.' '.mysql_error());
> while($data = mysql_fetch_assoc($req)) {
> echo $data['id'];
> }
> $sql2 = 'DELETE FROM table WHERE id="10" ';
> $req2 = mysql_query($sql2) or die('Erreur SQL
> ! '.$sql2.' '.mysql_error());
>
> 2/ It don't work :
>
> $sql = 'SELECT * FROM table WHERE id="'.$var.'" ';
> $req = mysql_query($sql) or die('Erreur SQL
> ! '.$sql.' '.mysql_error());
> while($data = mysql_fetch_assoc($req)) {
> echo $data['id'];
> }
> $sql2 = 'DELETE FROM table WHERE id="'.$var.'" ';
> $req2 = mysql_query($sql2) or die('Erreur SQL
> ! '.$sql2.' '.mysql_error());
>
>
> Results of this queries :
>
> In first case (it works) : I see the id get in mysql and it delete it
> after
>
> In second case (it don't work) : I don't see id get in mysql. It's like
> if it delete it first and after select.
>
> I have not error in php log.
>
>
> If somebody can help me, because I try since few hours...
>
>
> Best regards,
>
> David DURIEUX
> Tel : +33 (0)4.74.04.81.34
> Port : +33 (0)6.34.99.45.18
> Mail : d.durieux@siprossii.com
> Site Web : http://www.siprossii.com/
>
> SIPROSSII
> 847 route de Frans (Créacité)
> 69400 Villefranche sur Saône
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 11:21:22 von David DURIEUX
At the begining $var is $_GET['id'] and after I try directly $var =3D 10
but no changes.
On the server directly, I can only try with the values :=20
$sql =3D 'SELECT * FROM table WHERE id=3D"10" '; and for this no problem.
The problem is when I use a variable in query
Best regards,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 11:13:11 +0200
"Evert Lammerts" a =E9crit:
>> $sql =3D 'SELECT * FROM table WHERE id=3D"'.$var.'" ';
>> $req =3D mysql_query($sql) or die('Erreur SQL
>> ! '.$sql.' '.mysql_error());
>> while($data =3D mysql_fetch_assoc($req)) {
>> echo $data['id'];
>> }
>> $sql2 =3D 'DELETE FROM table WHERE id=3D"'.$var.'" ';
>> $req2 =3D mysql_query($sql2) or die('Erreur SQL
>> ! '.$sql2.' '.mysql_error());
>
>I'll ask the obvious: where and how is $var set, and did you echo your
>$sql variable to try the query on your mysql server directly?
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 11:22:43 von David DURIEUX
Bonjour,
I have print and it's OK, the query is good like if I put the value
directly in the query
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 17:17:51 +0800
"Kendo Tom" a =E9crit:
>Hi ,
>
> For this situation , you should print out the SQL statement to
> check=20
>the value of the variable "$var" .
>
>--------------------------------------------------
>From: "David DURIEUX"
>Sent: Wednesday, September 03, 2008 5:07 PM
>To:
>Subject: [PHP-DB] Probleme with MySQL queries
>
>> Hello
>>
>> There is a problem when I select a line in mysql table and afet I
>> delete it.
>>
>>
>> 1/ It works :
>> $sql =3D 'SELECT * FROM table WHERE id=3D"10" ';
>> $req =3D mysql_query($sql) or die('Erreur SQL
>> ! '.$sql.' '.mysql_error());
>> while($data =3D mysql_fetch_assoc($req)) {
>> echo $data['id'];
>> }
>> $sql2 =3D 'DELETE FROM table WHERE id=3D"10" ';
>> $req2 =3D mysql_query($sql2) or die('Erreur SQL
>> ! '.$sql2.' '.mysql_error());
>>
>> 2/ It don't work :
>>
>> $sql =3D 'SELECT * FROM table WHERE id=3D"'.$var.'" ';
>> $req =3D mysql_query($sql) or die('Erreur SQL
>> ! '.$sql.' '.mysql_error());
>> while($data =3D mysql_fetch_assoc($req)) {
>> echo $data['id'];
>> }
>> $sql2 =3D 'DELETE FROM table WHERE id=3D"'.$var.'" ';
>> $req2 =3D mysql_query($sql2) or die('Erreur SQL
>> ! '.$sql2.' '.mysql_error());
>>
>>
>> Results of this queries :
>>
>> In first case (it works) : I see the id get in mysql and it delete it
>> after
>>
>> In second case (it don't work) : I don't see id get in mysql. It's
>> like if it delete it first and after select.
>>
>> I have not error in php log.
>>
>>
>> If somebody can help me, because I try since few hours...
>>
>>
>> Best regards,
>>
>> David DURIEUX
>> Tel : +33 (0)4.74.04.81.34
>> Port : +33 (0)6.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>> --=20
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>=20
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 11:29:29 +0200
"Evert Lammerts" a =E9crit:
>Did you actually echo the $sql?
>
>I know it works right now, but try to take away the quotes around the
>value in the query and see if something happens:
>
>$sql =3D "SELECT * FROM table WHERE id=3D{$var}";
>
>If that doesn't work then var_dump($sql, $var) and write us the
>result. Also let us know the data type of the ID column.
>
>On Wed, Sep 3, 2008 at 11:21 AM, David DURIEUX
> wrote:
>> At the begining $var is $_GET['id'] and after I try directly $var =3D
>> 10 but no changes.
>>
>> On the server directly, I can only try with the values :
>> $sql =3D 'SELECT * FROM table WHERE id=3D"10" '; and for this no problem.
>>
>> The problem is when I use a variable in query
>>
>>
>> Best regards,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 11:13:11 +0200
>> "Evert Lammerts" a =E9crit:
>>
>>>> $sql =3D 'SELECT * FROM table WHERE id=3D"'.$var.'" ';
>>>> $req =3D mysql_query($sql) or die('Erreur SQL
>>>> ! '.$sql.' '.mysql_error());
>>>> while($data =3D mysql_fetch_assoc($req)) {
>>>> echo $data['id'];
>>>> }
>>>> $sql2 =3D 'DELETE FROM table WHERE id=3D"'.$var.'" ';
>>>> $req2 =3D mysql_query($sql2) or die('Erreur SQL
>>>> ! '.$sql2.' '.mysql_error());
>>>
>>>I'll ask the obvious: where and how is $var set, and did you echo
>>>your $sql variable to try the query on your mysql server directly?
>>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 11:37:37 von Evert Lammerts
>>If that doesn't work then var_dump($sql, $var) and write us the
>>result. Also let us know the data type of the ID column.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 11:45:25 von David DURIEUX
Bonjour,
string(40) "SELECT * FROM table WHERE id=3D107 "=20
string(3) "107"
string(38) "DELETE FROM table WHERE id=3D107 "=20
string(3) "107"=20
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 11:37:37 +0200
"Evert Lammerts" a =E9crit:
>>>If that doesn't work then var_dump($sql, $var) and write us the
>>>result. Also let us know the data type of the ID column.
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David DURIEUX wrote:
> Bonjour,
>
>
> string(40) "SELECT * FROM table WHERE id=107 "
> string(3) "107"
> string(38) "DELETE FROM table WHERE id=107 "
> string(3) "107"
>
>
>
> Cordialement,
>
> David DURIEUX
> Tel : 04.74.04.81.34
> Port : 06.34.99.45.18
> Mail : d.durieux@siprossii.com
> Site Web : http://www.siprossii.com/
>
> SIPROSSII
> 847 route de Frans (Créacité)
> 69400 Villefranche sur Saône
>
>
>
> Le Wed, 3 Sep 2008 11:37:37 +0200
> "Evert Lammerts" a écrit:
>
>
>>>> If that doesn't work then var_dump($sql, $var) and write us the
>>>> result. Also let us know the data type of the ID column.
>>>>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 12:02:00 von Evert Lammerts
> string(40) "SELECT * FROM table WHERE id=107 "
> string(3) "107"
And this query works when you run it on the database directly? Id 107 exists?
Assuming that that's both so we're running out of options.
After the select, can you do a print of mysql_error() and of mysql_num_rows()?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 12:02:16 von David DURIEUX
Bonjour,
No error for mysql_error for all 2 queries.
In fact the first return 0 results
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 03 Sep 2008 04:58:07 -0500
Micah Gersten a =E9crit:
>What does mysql_error return?
>
>Thank you,
>Micah Gersten
>onShore Networks
>Internal Developer
>http://www.onshore.com
>
>
>
>David DURIEUX wrote:
>> Bonjour,
>>
>>
>> string(40) "SELECT * FROM table WHERE id=3D107 "=20
>> string(3) "107"
>> string(38) "DELETE FROM table WHERE id=3D107 "=20
>> string(3) "107"=20
>>
>>
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 11:37:37 +0200
>> "Evert Lammerts" a =E9crit:
>>
>> =20
>>>>> If that doesn't work then var_dump($sql, $var) and write us the
>>>>> result. Also let us know the data type of the ID column.
>>>>> =20
>>
>>
>> =20
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 12:11:00 von Evert Lammerts
> In fact the first return 0 results
So the problem is in your select, and if your select works when you
manually insert the value for id (iow, without using $var), the
problem has something to do with $var.
Is the data type of the ID column INT? Try the following and let us
know the output:
$var=107;
$query = mysql_query("SELECT * FROM table WHERE id={$var};") or
die(mysql_error()); // make sure to use double quotes
var_dump(mysql_error(), mysql_num_rows());
$var=mysql_real_escape_string("107");
$query = mysql_query("SELECT * FROM table WHERE id={$var};") or
die(mysql_error()); // make sure to use double quotes
var_dump(mysql_error(), mysql_num_rows());
$query = mysql_query("SELECT * FROM table WHERE id=107;") or
die(mysql_error()); // make sure to use double quotes
var_dump(mysql_error(), mysql_num_rows());
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 12:21:00 von David DURIEUX
Bonjour,
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
ID is INT. It's ok before.
I have errors :=20
Warning: Wrong parameter count for mysql_num_rows()
in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
on line 7 string(0) "" NULL
Warning: Wrong parameter count for mysql_num_rows()
in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
on line 12 string(0) "" NULL
Warning: Wrong parameter count for mysql_num_rows()
in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
on line 16 string(0) "" NULL=20
Le Wed, 3 Sep 2008 12:11:00 +0200
"Evert Lammerts" a =E9crit:
>> In fact the first return 0 results
>
>So the problem is in your select, and if your select works when you
>manually insert the value for id (iow, without using $var), the
>problem has something to do with $var.
>
>Is the data type of the ID column INT? Try the following and let us
>know the output:
>
>$var=3D107;
>$query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};") or
>die(mysql_error()); // make sure to use double quotes
>var_dump(mysql_error(), mysql_num_rows());
>
>$var=3Dmysql_real_escape_string("107");
>$query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};") or
>die(mysql_error()); // make sure to use double quotes
>var_dump(mysql_error(), mysql_num_rows());
>
>$query =3D mysql_query("SELECT * FROM table WHERE id=3D107;") or
>die(mysql_error()); // make sure to use double quotes
>var_dump(mysql_error(), mysql_num_rows());
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 12:23:19 von Micah Gersten
You have to pass mysql_num_rows a $result variable from your query.
David DURIEUX wrote:
> Bonjour,
>
>
>
> Cordialement,
>
> David DURIEUX
> Tel : 04.74.04.81.34
> Port : 06.34.99.45.18
> Mail : d.durieux@siprossii.com
> Site Web : http://www.siprossii.com/
>
> SIPROSSII
> 847 route de Frans (Créacité)
> 69400 Villefranche sur Saône
>
> ID is INT. It's ok before.
>
> I have errors :
>
>
> Warning: Wrong parameter count for mysql_num_rows()
> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
> on line 7 string(0) "" NULL
>
> Warning: Wrong parameter count for mysql_num_rows()
> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
> on line 12 string(0) "" NULL
>
> Warning: Wrong parameter count for mysql_num_rows()
> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
> on line 16 string(0) "" NULL
>
>
>
> Le Wed, 3 Sep 2008 12:11:00 +0200
> "Evert Lammerts" a écrit:
>
>
>>> In fact the first return 0 results
>>>
>> So the problem is in your select, and if your select works when you
>> manually insert the value for id (iow, without using $var), the
>> problem has something to do with $var.
>>
>> Is the data type of the ID column INT? Try the following and let us
>> know the output:
>>
>> $var=107;
>> $query = mysql_query("SELECT * FROM table WHERE id={$var};") or
>> die(mysql_error()); // make sure to use double quotes
>> var_dump(mysql_error(), mysql_num_rows());
>>
>> $var=mysql_real_escape_string("107");
>> $query = mysql_query("SELECT * FROM table WHERE id={$var};") or
>> die(mysql_error()); // make sure to use double quotes
>> var_dump(mysql_error(), mysql_num_rows());
>>
>> $query = mysql_query("SELECT * FROM table WHERE id=107;") or
>> die(mysql_error()); // make sure to use double quotes
>> var_dump(mysql_error(), mysql_num_rows());
>>
>>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 03 Sep 2008 05:23:19 -0500
Micah Gersten a =E9crit:
>You have to pass mysql_num_rows a $result variable from your query.
>
>Thank you,
>Micah Gersten
>onShore Networks
>Internal Developer
>http://www.onshore.com
>
>
>
>David DURIEUX wrote:
>> Bonjour,
>>
>>
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>> ID is INT. It's ok before.
>>
>> I have errors :=20
>>
>>
>> Warning: Wrong parameter count for mysql_num_rows()
>> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
>> on line 7 string(0) "" NULL
>>
>> Warning: Wrong parameter count for mysql_num_rows()
>> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
>> on line 12 string(0) "" NULL
>>
>> Warning: Wrong parameter count for mysql_num_rows()
>> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma ines.php
>> on line 16 string(0) "" NULL=20
>>
>>
>>
>> Le Wed, 3 Sep 2008 12:11:00 +0200
>> "Evert Lammerts" a =E9crit:
>>
>> =20
>>>> In fact the first return 0 results
>>>> =20
>>> So the problem is in your select, and if your select works when you
>>> manually insert the value for id (iow, without using $var), the
>>> problem has something to do with $var.
>>>
>>> Is the data type of the ID column INT? Try the following and let us
>>> know the output:
>>>
>>> $var=3D107;
>>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};") or
>>> die(mysql_error()); // make sure to use double quotes
>>> var_dump(mysql_error(), mysql_num_rows());
>>>
>>> $var=3Dmysql_real_escape_string("107");
>>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};") or
>>> die(mysql_error()); // make sure to use double quotes
>>> var_dump(mysql_error(), mysql_num_rows());
>>>
>>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D107;") or
>>> die(mysql_error()); // make sure to use double quotes
>>> var_dump(mysql_error(), mysql_num_rows());
>>>
>>> =20
>>
>>
>> =20
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Note : The ID is good deleted but no select return
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 12:54:19 +0200
"Evert Lammerts" a =E9crit:
>What does var_dump($_GET) say?
>
>On Wed, Sep 3, 2008 at 12:48 PM, David DURIEUX
> wrote:
>> Bonjour,
>>
>> The query works
>>
>> But when I wrote this :
>>
>>
>> if (isset($_GET['deleteid'])){
>>
>> $var=3D108;
>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};")
>> or die("select error: " . mysql_error());
>>
>> if ($row =3D mysql_fetch_assoc($query))
>> var_dump ($row);
>>
>> $query =3D mysql_query("DELETE FROM table WHERE id=3D{$var}") or
>> die("delete error: " . mysql_error());
>>
>>
>> }
>>
>>
>> It not works and no return and no error .
>>
>> If I place the query you have sent me without the if it works but I
>> must have a if for delete the ID
>>
>> It is very strange
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 12:39:45 +0200
>> "Evert Lammerts" a =E9crit:
>>
>>>Fixed then?
>>>
>>>On Wed, Sep 3, 2008 at 12:39 PM, David DURIEUX
>>> wrote:
>>>> Bonjour,
>>>>
>>>> Yes I have the values
>>>>
>>>> array(5) { ["id"]=3D> string(3) "121" ["domaine"]=3D> string(1)
>>>> "1" ["sous_domaine"]=3D> string(8) "aaaaaaaa" ["repertoire"]=3D>
>>>> string(0) "" ["redirection"]=3D> string(1) "0" }
>>>>
>>>>
>>>> Cordialement,
>>>>
>>>> David DURIEUX
>>>> Tel : 04.74.04.81.34
>>>> Port : 06.34.99.45.18
>>>> Mail : d.durieux@siprossii.com
>>>> Site Web : http://www.siprossii.com/
>>>>
>>>> SIPROSSII
>>>> 847 route de Frans (Cr=E9acit=E9)
>>>> 69400 Villefranche sur Sa=F4ne
>>>>
>>>>
>>>>
>>>> Le Wed, 3 Sep 2008 12:36:43 +0200
>>>> "Evert Lammerts" a =E9crit:
>>>>
>>>>>I keep on making mistakes. $data should be $row in the var_dump -
>>>>>but right now your DELETE has already deleted id 17 (the fact that
>>>>>it prints NULL means the if condition was satisfied). So replace
>>>>>the below code with a different $var value:
>>>>>
>>>>>$var=3D107;
>>>>>$query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};") or
>>>>>die("select error: " . mysql_error());
>>>>>
>>>>>if ($row =3D mysql_fetch_assoc($query))
>>>>> var_dump ($row);
>>>>>
>>>>>$query =3D mysql_query("DELETE FROM table WHERE id=3D{$var}") or
>>>>>die("delete error: " . mysql_error());
>>>>>
>>>>>On Wed, Sep 3, 2008 at 12:33 PM, David DURIEUX
>>>>> wrote:
>>>>>> Bonjour,
>>>>>>
>>>>>> I have :
>>>>>>
>>>>>> NULL
>>>>>>
>>>>>>
>>>>>>
>>>>>> Cordialement,
>>>>>>
>>>>>> David DURIEUX
>>>>>> Tel : 04.74.04.81.34
>>>>>> Port : 06.34.99.45.18
>>>>>> Mail : d.durieux@siprossii.com
>>>>>> Site Web : http://www.siprossii.com/
>>>>>>
>>>>>> SIPROSSII
>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>
>>>>>>
>>>>>>
>>>>>> Le Wed, 3 Sep 2008 12:29:44 +0200
>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>
>>>>>>>Which means you do get results and your select works.
>>>>>>>
>>>>>>>Now try:
>>>>>>>
>>>>>>>$var=3D107;
>>>>>>>$query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};") or
>>>>>>>die(mysql_error());
>>>>>>>
>>>>>>>if ($row =3D mysql_fetch_assoc($query))
>>>>>>> var_dump ($data);
>>>>>>>
>>>>>>>$query =3D mysql_query("DELETE FROM table WHERE id=3D{$var}") or
>>>>>>>die(mysql_error());
>>>>>>>
>>>>>>>On Wed, Sep 3, 2008 at 12:25 PM, David DURIEUX
>>>>>>> wrote:
>>>>>>>> Bonjour,
>>>>>>>>
>>>>>>>> string(0) "" int(1)
>>>>>>>> string(0) "" int(1)
>>>>>>>> string(0) "" int(1)
>>>>>>>>
>>>>>>>> Cordialement,
>>>>>>>>
>>>>>>>> David DURIEUX
>>>>>>>> Tel : 04.74.04.81.34
>>>>>>>> Port : 06.34.99.45.18
>>>>>>>> Mail : d.durieux@siprossii.com
>>>>>>>> Site Web : http://www.siprossii.com/
>>>>>>>>
>>>>>>>> SIPROSSII
>>>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Le Wed, 03 Sep 2008 05:23:19 -0500
>>>>>>>> Micah Gersten a =E9crit:
>>>>>>>>
>>>>>>>>>You have to pass mysql_num_rows a $result variable from your
>>>>>>>>>query.
>>>>>>>>>
>>>>>>>>>Thank you,
>>>>>>>>>Micah Gersten
>>>>>>>>>onShore Networks
>>>>>>>>>Internal Developer
>>>>>>>>>http://www.onshore.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>David DURIEUX wrote:
>>>>>>>>>> Bonjour,
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Cordialement,
>>>>>>>>>>
>>>>>>>>>> David DURIEUX
>>>>>>>>>> Tel : 04.74.04.81.34
>>>>>>>>>> Port : 06.34.99.45.18
>>>>>>>>>> Mail : d.durieux@siprossii.com
>>>>>>>>>> Site Web : http://www.siprossii.com/
>>>>>>>>>>
>>>>>>>>>> SIPROSSII
>>>>>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>>>>>
>>>>>>>>>> ID is INT. It's ok before.
>>>>>>>>>>
>>>>>>>>>> I have errors :
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Warning: Wrong parameter count for mysql_num_rows()
>>>>>>>>>> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma i=
nes.php
>>>>>>>>>> on line 7 string(0) "" NULL
>>>>>>>>>>
>>>>>>>>>> Warning: Wrong parameter count for mysql_num_rows()
>>>>>>>>>> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma i=
nes.php
>>>>>>>>>> on line 12 string(0) "" NULL
>>>>>>>>>>
>>>>>>>>>> Warning: Wrong parameter count for mysql_num_rows()
>>>>>>>>>> in /usr/home/sites/CL000001/Web_data/hebergement/pages/sousdoma i=
nes.php
>>>>>>>>>> on line 16 string(0) "" NULL
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Le Wed, 3 Sep 2008 12:11:00 +0200
>>>>>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>> In fact the first return 0 results
>>>>>>>>>>>>
>>>>>>>>>>> So the problem is in your select, and if your select works
>>>>>>>>>>> when you manually insert the value for id (iow, without
>>>>>>>>>>> using $var), the problem has something to do with $var.
>>>>>>>>>>>
>>>>>>>>>>> Is the data type of the ID column INT? Try the following and
>>>>>>>>>>> let us know the output:
>>>>>>>>>>>
>>>>>>>>>>> $var=3D107;
>>>>>>>>>>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};")
>>>>>>>>>>> or die(mysql_error()); // make sure to use double quotes
>>>>>>>>>>> var_dump(mysql_error(), mysql_num_rows());
>>>>>>>>>>>
>>>>>>>>>>> $var=3Dmysql_real_escape_string("107");
>>>>>>>>>>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};")
>>>>>>>>>>> or die(mysql_error()); // make sure to use double quotes
>>>>>>>>>>> var_dump(mysql_error(), mysql_num_rows());
>>>>>>>>>>>
>>>>>>>>>>> $query =3D mysql_query("SELECT * FROM table WHERE id=3D107;") or
>>>>>>>>>>> die(mysql_error()); // make sure to use double quotes
>>>>>>>>>>> var_dump(mysql_error(), mysql_num_rows());
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I have :
>
> array(2) { ["module"]=> string(12) "sousdomaines" ["deleteid"]=>
> string(3) "134" }
>
> But the ID is not deleted in mysql.
That seems to be your var_dump($_GET), which means that either if
(isset($_GET['deleteid'])) evaluates to FALSE or your SELECT does not
return results. Let's check:
if (strlen($_GET["deleteid"])) {
var_dump($_GET["deleteid"]);
$var = mysql_real_escape_string($_GET["deleteid"]);
$query = mysql_query("SELECT * FROM table WHERE id={$var};")
or die("select error: " . mysql_error());
var_dump(mysql_num_rows($query));
if ($row = mysql_fetch_assoc($query)) {
var_dump ($row);
mysql_query("DELETE FROM table WHERE id={$row['id']}") or
die("delete error: " . mysql_error());
}
}
> In must be away for 2 or 3 hours, I return after to continue this.
French lunch I'm guessing :-) I'm jealous! You guys know how to do
that, with your perfect cheese and sausage! I'll be away myself from
half past 2.
Try to keep your replies on the list - it's useful for others.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 14:12:01 von David DURIEUX
Bonjour,
I Have now :=20
string(3) "134" int(0)
Lunch... NOT, I haven't the time today :p but cheese and sausage is
good :)
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 13:19:52 +0200
"Evert Lammerts" a =E9crit:
>> I have :
>>
>> array(2) { ["module"]=3D> string(12) "sousdomaines" ["deleteid"]=3D>
>> string(3) "134" }
>>
>> But the ID is not deleted in mysql.
>
>That seems to be your var_dump($_GET), which means that either if
>(isset($_GET['deleteid'])) evaluates to FALSE or your SELECT does not
>return results. Let's check:
>
>if (strlen($_GET["deleteid"])) {
> var_dump($_GET["deleteid"]);
> $var =3D mysql_real_escape_string($_GET["deleteid"]);
> $query =3D mysql_query("SELECT * FROM table WHERE id=3D{$var};")
>or die("select error: " . mysql_error());
> var_dump(mysql_num_rows($query));
> if ($row =3D mysql_fetch_assoc($query)) {
> var_dump ($row);
> mysql_query("DELETE FROM table WHERE id=3D{$row['id']}") or
>die("delete error: " . mysql_error());
> }
>}
>
>> In must be away for 2 or 3 hours, I return after to continue this.
>French lunch I'm guessing :-) I'm jealous! You guys know how to do
>that, with your perfect cheese and sausage! I'll be away myself from
>half past 2.
>
>Try to keep your replies on the list - it's useful for others.
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 14:17:59 von Evert Lammerts
> string(3) "134" int(0)
This means you're trying to delete the entry with id=3, and that it
cannot find that in the database. Are you sure it exists? We tried the
queries separately and the SELECT had no problem... SELECT * FROM
table WHERE id=3;
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 14:20:14 von David DURIEUX
Bonjour,
Are you sur it is 3 ? it is 134 no?
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 14:17:59 +0200
"Evert Lammerts" a =E9crit:
>> string(3) "134" int(0)
>
>This means you're trying to delete the entry with id=3D3, and that it
>cannot find that in the database. Are you sure it exists? We tried the
>queries separately and the SELECT had no problem... SELECT * FROM
>table WHERE id=3D3;
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 14:21:47 von David DURIEUX
Bonjour,
Humm with this query I have forgotten to tell you the ID is DELETED=20
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 14:17:59 +0200
"Evert Lammerts" a =E9crit:
>> string(3) "134" int(0)
>
>This means you're trying to delete the entry with id=3D3, and that it
>cannot find that in the database. Are you sure it exists? We tried the
>queries separately and the SELECT had no problem... SELECT * FROM
>table WHERE id=3D3;
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 14:24:23 von Evert Lammerts
> Humm with this query I have forgotten to tell you the ID is DELETED
You mean the record with id=134?
> Are you sur it is 3 ? it is 134 no?
You're right :-)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 14:26:27 von David DURIEUX
Bonjour,
Yes record exist before the query and is deleted after
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 14:24:23 +0200
"Evert Lammerts" a =E9crit:
>> Humm with this query I have forgotten to tell you the ID is DELETED
>
>You mean the record with id=3D134?
>
>> Are you sur it is 3 ? it is 134 no?
>
>You're right :-)
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 19:41:27 von Dee Ayy
When using mysql_query, the SQL string to be executed should not end
in a semicolon. Your initial post did not have a semicolon (but you
obviously edited it to make it generic). Perhaps this was the initial
problem? Subsequent posts had you terminating your queries with a
semicolon.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 19:58:06 von Evert Lammerts
On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
> When using mysql_query, the SQL string to be executed should not end
> in a semicolon.
Ending a query with a semicolon should not be a problem - the string
is parsed by the mysql server, which handles it fine.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:05:22 von Evert Lammerts
On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts wrote:
> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
>> When using mysql_query, the SQL string to be executed should not end
>> in a semicolon.
>
> Ending a query with a semicolon should not be a problem - the string
> is parsed by the mysql server, which handles it fine.
The manual does mention it, I'm a little too quick with my replies. I
personally never had a problem with it though. Plus, it seemed to work
some mails ago.
David, did I understand well that your problem is solved?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:29:03 von David DURIEUX
Bonjour,
No, I must test a little more, I tell in few minutes....
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 20:05:22 +0200
"Evert Lammerts" a =E9crit:
>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
> wrote:
>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
>>> When using mysql_query, the SQL string to be executed should not end
>>> in a semicolon.
>>
>> Ending a query with a semicolon should not be a problem - the string
>> is parsed by the mysql server, which handles it fine.
>
>The manual does mention it, I'm a little too quick with my replies. I
>personally never had a problem with it though. Plus, it seemed to work
>some mails ago.
>
>David, did I understand well that your problem is solved?
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:29:32 von Dee Ayy
On Wed, Sep 3, 2008 at 1:05 PM, Evert Lammerts wrote:
> On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts wrote:
>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
>>> When using mysql_query, the SQL string to be executed should not end
>>> in a semicolon.
>>
>> Ending a query with a semicolon should not be a problem - the string
>> is parsed by the mysql server, which handles it fine.
>
> The manual does mention it, I'm a little too quick with my replies. I
> personally never had a problem with it though. Plus, it seemed to work
> some mails ago.
>
> David, did I understand well that your problem is solved?
>
I have run into problems with it, and it is in the manual. But a test
case today did not display the problem on PHP version 4.1.2 and
version 5.1.6.
As I understood, this is/was a security feature so that SQL injection
could not terminate the real query, and add additional hacker queries
to the real query.
Now I'd like to know why it _IS_ executing _WITH_ a semicolon
_DESPITE_ what the manual says. Perhaps some
easily_forgettable_magic_flag.ini setting? Gotta love PHP for that.
Can we really rely completely on mysql_real_escape_string?
When David said the SELECT did not work, but the DELETE worked, I
thought for sure the semicolon was the problem. Also, that maybe he
just removed the SELECT part so he could move on.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:35:03 von David DURIEUX
Bonjour,
I have always the problem, select =3D 0 rows and it delete it like if
delete is before the select :/
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 20:05:22 +0200
"Evert Lammerts" a =E9crit:
>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
> wrote:
>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
>>> When using mysql_query, the SQL string to be executed should not end
>>> in a semicolon.
>>
>> Ending a query with a semicolon should not be a problem - the string
>> is parsed by the mysql server, which handles it fine.
>
>The manual does mention it, I'm a little too quick with my replies. I
>personally never had a problem with it though. Plus, it seemed to work
>some mails ago.
>
>David, did I understand well that your problem is solved?
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX wrote:
>> Bonjour,
>>
>> I have always the problem, select = 0 rows and it delete it like if
>> delete is before the select :/
>>
>> Cordialement,
>>
>> David DURIEUX
Your SELECT has a terminating semicolon. Your DELETE does not. Some
configurations of PHP do not execute from the mysql_query function if
the query is terminated with a semicolon.
What version of PHP are you using?
I wish I knew what flags to also ask about that affect the semicolon.
If in fact your problem is the semicolon.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:49:11 von David DURIEUX
Bonjour,
Yes I'm using this query.... and no row select
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 20:43:25 +0200
"Evert Lammerts" a =E9crit:
>Are you still using the code we talked about?
>
>if ($row =3D mysql_fetch_assoc($query)) {
> var_dump ($row);
> mysql_query("DELETE FROM table WHERE id=3D{$row['id']}") or
>die("delete error: " . mysql_error());
>}
>
>if so, apparently it does fetch a row. Otherwise, can you send the
>code you're using?
>
>On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
> wrote:
>> Bonjour,
>>
>> I have always the problem, select =3D 0 rows and it delete it like if
>> delete is before the select :/
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 20:05:22 +0200
>> "Evert Lammerts" a =E9crit:
>>
>>>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>> wrote:
>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
>>>>> When using mysql_query, the SQL string to be executed should not
>>>>> end in a semicolon.
>>>>
>>>> Ending a query with a semicolon should not be a problem - the
>>>> string is parsed by the mysql server, which handles it fine.
>>>
>>>The manual does mention it, I'm a little too quick with my replies. I
>>>personally never had a problem with it though. Plus, it seemed to
>>>work some mails ago.
>>>
>>>David, did I understand well that your problem is solved?
>>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:50:38 von David DURIEUX
Bonjour,
PHP 5.2.6 on FreeBSD 7.0 i386 associate with apache 2.0.63
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 13:47:02 -0500
"Dee Ayy" a =E9crit:
>> On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>> wrote:
>>> Bonjour,
>>>
>>> I have always the problem, select =3D 0 rows and it delete it like if
>>> delete is before the select :/
>>>
>>> Cordialement,
>>>
>>> David DURIEUX
>
>Your SELECT has a terminating semicolon. Your DELETE does not. Some
>configurations of PHP do not execute from the mysql_query function if
>the query is terminated with a semicolon.
>
>What version of PHP are you using?
>I wish I knew what flags to also ask about that affect the semicolon.
>If in fact your problem is the semicolon.
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yes DELETE is executed and I have on my page :=20
string(3) "140"
int(0)
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 20:51:49 +0200
"Evert Lammerts" a =E9crit:
>But the DELETE is executed? If it is, and it's in the condition, like
>in the above code:
>
>if ($row =3D mysql_fetch_assoc($query)) {
> .... DELETE ...
>}
>
>something apparently is fetched....
>
>On Wed, Sep 3, 2008 at 8:49 PM, David DURIEUX
> wrote:
>> Bonjour,
>>
>> Yes I'm using this query.... and no row select
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 20:43:25 +0200
>> "Evert Lammerts" a =E9crit:
>>
>>>Are you still using the code we talked about?
>>>
>>>if ($row =3D mysql_fetch_assoc($query)) {
>>> var_dump ($row);
>>> mysql_query("DELETE FROM table WHERE id=3D{$row['id']}") or
>>>die("delete error: " . mysql_error());
>>>}
>>>
>>>if so, apparently it does fetch a row. Otherwise, can you send the
>>>code you're using?
>>>
>>>On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>>> wrote:
>>>> Bonjour,
>>>>
>>>> I have always the problem, select =3D 0 rows and it delete it like if
>>>> delete is before the select :/
>>>>
>>>> Cordialement,
>>>>
>>>> David DURIEUX
>>>> Tel : 04.74.04.81.34
>>>> Port : 06.34.99.45.18
>>>> Mail : d.durieux@siprossii.com
>>>> Site Web : http://www.siprossii.com/
>>>>
>>>> SIPROSSII
>>>> 847 route de Frans (Cr=E9acit=E9)
>>>> 69400 Villefranche sur Sa=F4ne
>>>>
>>>>
>>>>
>>>> Le Wed, 3 Sep 2008 20:05:22 +0200
>>>> "Evert Lammerts" a =E9crit:
>>>>
>>>>>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>>>> wrote:
>>>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy
>>>>>> wrote:
>>>>>>> When using mysql_query, the SQL string to be executed should not
>>>>>>> end in a semicolon.
>>>>>>
>>>>>> Ending a query with a semicolon should not be a problem - the
>>>>>> string is parsed by the mysql server, which handles it fine.
>>>>>
>>>>>The manual does mention it, I'm a little too quick with my
>>>>>replies. I personally never had a problem with it though. Plus, it
>>>>>seemed to work some mails ago.
>>>>>
>>>>>David, did I understand well that your problem is solved?
>>>>>
>>>>
>>>>
>>>> --
>>>> PHP Database Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 20:56:55 von Micah Gersten
Can you turn on mysql query logging and see what is actually happening?
David DURIEUX wrote:
> Bonjour,
>
> Yes I'm using this query.... and no row select
>
> Cordialement,
>
> David DURIEUX
> Tel : 04.74.04.81.34
> Port : 06.34.99.45.18
> Mail : d.durieux@siprossii.com
> Site Web : http://www.siprossii.com/
>
> SIPROSSII
> 847 route de Frans (Créacité)
> 69400 Villefranche sur Saône
>
>
>
> Le Wed, 3 Sep 2008 20:43:25 +0200
> "Evert Lammerts" a écrit:
>
>
>> Are you still using the code we talked about?
>>
>> if ($row = mysql_fetch_assoc($query)) {
>> var_dump ($row);
>> mysql_query("DELETE FROM table WHERE id={$row['id']}") or
>> die("delete error: " . mysql_error());
>> }
>>
>> if so, apparently it does fetch a row. Otherwise, can you send the
>> code you're using?
>>
>> On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>> wrote:
>>
>>> Bonjour,
>>>
>>> I have always the problem, select = 0 rows and it delete it like if
>>> delete is before the select :/
>>>
>>> Cordialement,
>>>
>>> David DURIEUX
>>> Tel : 04.74.04.81.34
>>> Port : 06.34.99.45.18
>>> Mail : d.durieux@siprossii.com
>>> Site Web : http://www.siprossii.com/
>>>
>>> SIPROSSII
>>> 847 route de Frans (Créacité)
>>> 69400 Villefranche sur Saône
>>>
>>>
>>>
>>> Le Wed, 3 Sep 2008 20:05:22 +0200
>>> "Evert Lammerts" a écrit:
>>>
>>>
>>>> On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>>> wrote:
>>>>
>>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy wrote:
>>>>>
>>>>>> When using mysql_query, the SQL string to be executed should not
>>>>>> end in a semicolon.
>>>>>>
>>>>> Ending a query with a semicolon should not be a problem - the
>>>>> string is parsed by the mysql server, which handles it fine.
>>>>>
>>>> The manual does mention it, I'm a little too quick with my replies. I
>>>> personally never had a problem with it though. Plus, it seemed to
>>>> work some mails ago.
>>>>
>>>> David, did I understand well that your problem is solved?
>>>>
>>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
It was difficult, I have many files in includes, I will try to execute
this code before in the php execution to see what code give problem.
I try this now and I tell you the results of investigations
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 21:01:14 +0200
"Evert Lammerts" a =E9crit:
>This is weird. Can you send over the complete file?
>
>On Wed, Sep 3, 2008 at 8:56 PM, David DURIEUX
> wrote:
>> Bonjour,
>>
>> Yes DELETE is executed and I have on my page :
>> string(3) "140"
>> int(0)
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 20:51:49 +0200
>> "Evert Lammerts" a =E9crit:
>>
>>>But the DELETE is executed? If it is, and it's in the condition, like
>>>in the above code:
>>>
>>>if ($row =3D mysql_fetch_assoc($query)) {
>>> .... DELETE ...
>>>}
>>>
>>>something apparently is fetched....
>>>
>>>On Wed, Sep 3, 2008 at 8:49 PM, David DURIEUX
>>> wrote:
>>>> Bonjour,
>>>>
>>>> Yes I'm using this query.... and no row select
>>>>
>>>> Cordialement,
>>>>
>>>> David DURIEUX
>>>> Tel : 04.74.04.81.34
>>>> Port : 06.34.99.45.18
>>>> Mail : d.durieux@siprossii.com
>>>> Site Web : http://www.siprossii.com/
>>>>
>>>> SIPROSSII
>>>> 847 route de Frans (Cr=E9acit=E9)
>>>> 69400 Villefranche sur Sa=F4ne
>>>>
>>>>
>>>>
>>>> Le Wed, 3 Sep 2008 20:43:25 +0200
>>>> "Evert Lammerts" a =E9crit:
>>>>
>>>>>Are you still using the code we talked about?
>>>>>
>>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>>> var_dump ($row);
>>>>> mysql_query("DELETE FROM table WHERE id=3D{$row['id']}")
>>>>> or
>>>>>die("delete error: " . mysql_error());
>>>>>}
>>>>>
>>>>>if so, apparently it does fetch a row. Otherwise, can you send the
>>>>>code you're using?
>>>>>
>>>>>On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>>>>> wrote:
>>>>>> Bonjour,
>>>>>>
>>>>>> I have always the problem, select =3D 0 rows and it delete it like
>>>>>> if delete is before the select :/
>>>>>>
>>>>>> Cordialement,
>>>>>>
>>>>>> David DURIEUX
>>>>>> Tel : 04.74.04.81.34
>>>>>> Port : 06.34.99.45.18
>>>>>> Mail : d.durieux@siprossii.com
>>>>>> Site Web : http://www.siprossii.com/
>>>>>>
>>>>>> SIPROSSII
>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>
>>>>>>
>>>>>>
>>>>>> Le Wed, 3 Sep 2008 20:05:22 +0200
>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>
>>>>>>>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>>>>>> wrote:
>>>>>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy
>>>>>>>> wrote:
>>>>>>>>> When using mysql_query, the SQL string to be executed should
>>>>>>>>> not end in a semicolon.
>>>>>>>>
>>>>>>>> Ending a query with a semicolon should not be a problem - the
>>>>>>>> string is parsed by the mysql server, which handles it fine.
>>>>>>>
>>>>>>>The manual does mention it, I'm a little too quick with my
>>>>>>>replies. I personally never had a problem with it though. Plus,
>>>>>>>it seemed to work some mails ago.
>>>>>>>
>>>>>>>David, did I understand well that your problem is solved?
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> PHP Database Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>
>>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 21:27:28 von Evert Lammerts
> Your SELECT has a terminating semicolon.
I'm guessing Multiple statement execution is enabled by default...
http://dev.mysql.com/doc/refman/5.0/en/mysql-query.html
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Probleme with MySQL queries
am 03.09.2008 21:50:42 von David DURIEUX
Bonjour,
Humm if I go on page index.php?deleteid=3D139=20
it works
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 21:08:25 +0200
David DURIEUX a =E9crit:
>Bonjour,
>
>It was difficult, I have many files in includes, I will try to execute
>this code before in the php execution to see what code give problem.
>
>I try this now and I tell you the results of investigations
>
>
>Cordialement,
>
>David DURIEUX
>Tel : 04.74.04.81.34
>Port : 06.34.99.45.18
>Mail : d.durieux@siprossii.com
>Site Web : http://www.siprossii.com/
>
>SIPROSSII
>847 route de Frans (Cr=E9acit=E9)
>69400 Villefranche sur Sa=F4ne
>
>
>
>Le Wed, 3 Sep 2008 21:01:14 +0200
>"Evert Lammerts" a =E9crit:
>
>>This is weird. Can you send over the complete file?
>>
>>On Wed, Sep 3, 2008 at 8:56 PM, David DURIEUX
>> wrote:
>>> Bonjour,
>>>
>>> Yes DELETE is executed and I have on my page :
>>> string(3) "140"
>>> int(0)
>>>
>>> Cordialement,
>>>
>>> David DURIEUX
>>> Tel : 04.74.04.81.34
>>> Port : 06.34.99.45.18
>>> Mail : d.durieux@siprossii.com
>>> Site Web : http://www.siprossii.com/
>>>
>>> SIPROSSII
>>> 847 route de Frans (Cr=E9acit=E9)
>>> 69400 Villefranche sur Sa=F4ne
>>>
>>>
>>>
>>> Le Wed, 3 Sep 2008 20:51:49 +0200
>>> "Evert Lammerts" a =E9crit:
>>>
>>>>But the DELETE is executed? If it is, and it's in the condition,
>>>>like in the above code:
>>>>
>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>> .... DELETE ...
>>>>}
>>>>
>>>>something apparently is fetched....
>>>>
>>>>On Wed, Sep 3, 2008 at 8:49 PM, David DURIEUX
>>>> wrote:
>>>>> Bonjour,
>>>>>
>>>>> Yes I'm using this query.... and no row select
>>>>>
>>>>> Cordialement,
>>>>>
>>>>> David DURIEUX
>>>>> Tel : 04.74.04.81.34
>>>>> Port : 06.34.99.45.18
>>>>> Mail : d.durieux@siprossii.com
>>>>> Site Web : http://www.siprossii.com/
>>>>>
>>>>> SIPROSSII
>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>
>>>>>
>>>>>
>>>>> Le Wed, 3 Sep 2008 20:43:25 +0200
>>>>> "Evert Lammerts" a =E9crit:
>>>>>
>>>>>>Are you still using the code we talked about?
>>>>>>
>>>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>>>> var_dump ($row);
>>>>>> mysql_query("DELETE FROM table WHERE id=3D{$row['id']}")
>>>>>> or
>>>>>>die("delete error: " . mysql_error());
>>>>>>}
>>>>>>
>>>>>>if so, apparently it does fetch a row. Otherwise, can you send the
>>>>>>code you're using?
>>>>>>
>>>>>>On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>>>>>> wrote:
>>>>>>> Bonjour,
>>>>>>>
>>>>>>> I have always the problem, select =3D 0 rows and it delete it like
>>>>>>> if delete is before the select :/
>>>>>>>
>>>>>>> Cordialement,
>>>>>>>
>>>>>>> David DURIEUX
>>>>>>> Tel : 04.74.04.81.34
>>>>>>> Port : 06.34.99.45.18
>>>>>>> Mail : d.durieux@siprossii.com
>>>>>>> Site Web : http://www.siprossii.com/
>>>>>>>
>>>>>>> SIPROSSII
>>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Le Wed, 3 Sep 2008 20:05:22 +0200
>>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>>
>>>>>>>>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>>>>>>> wrote:
>>>>>>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy
>>>>>>>>> wrote:
>>>>>>>>>> When using mysql_query, the SQL string to be executed should
>>>>>>>>>> not end in a semicolon.
>>>>>>>>>
>>>>>>>>> Ending a query with a semicolon should not be a problem - the
>>>>>>>>> string is parsed by the mysql server, which handles it fine.
>>>>>>>>
>>>>>>>>The manual does mention it, I'm a little too quick with my
>>>>>>>>replies. I personally never had a problem with it though. Plus,
>>>>>>>>it seemed to work some mails ago.
>>>>>>>>
>>>>>>>>David, did I understand well that your problem is solved?
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>
>>>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
>Bonjour,
>
>Humm if I go on page index.php?deleteid=3D139=20
>it works
>
>If I click on the link
>type=3D"submit" value=3D"Supprimer" style=3D"width: 100px; " />
>I have the SELECT problem
>
>I will be crazy=20
>
>Cordialement,
>
>David DURIEUX
>Tel : 04.74.04.81.34
>Port : 06.34.99.45.18
>Mail : d.durieux@siprossii.com
>Site Web : http://www.siprossii.com/
>
>SIPROSSII
>847 route de Frans (Cr=E9acit=E9)
>69400 Villefranche sur Sa=F4ne
>
>
>
>Le Wed, 3 Sep 2008 21:08:25 +0200
>David DURIEUX a =E9crit:
>
>>Bonjour,
>>
>>It was difficult, I have many files in includes, I will try to execute
>>this code before in the php execution to see what code give problem.
>>
>>I try this now and I tell you the results of investigations
>>
>>
>>Cordialement,
>>
>>David DURIEUX
>>Tel : 04.74.04.81.34
>>Port : 06.34.99.45.18
>>Mail : d.durieux@siprossii.com
>>Site Web : http://www.siprossii.com/
>>
>>SIPROSSII
>>847 route de Frans (Cr=E9acit=E9)
>>69400 Villefranche sur Sa=F4ne
>>
>>
>>
>>Le Wed, 3 Sep 2008 21:01:14 +0200
>>"Evert Lammerts" a =E9crit:
>>
>>>This is weird. Can you send over the complete file?
>>>
>>>On Wed, Sep 3, 2008 at 8:56 PM, David DURIEUX
>>> wrote:
>>>> Bonjour,
>>>>
>>>> Yes DELETE is executed and I have on my page :
>>>> string(3) "140"
>>>> int(0)
>>>>
>>>> Cordialement,
>>>>
>>>> David DURIEUX
>>>> Tel : 04.74.04.81.34
>>>> Port : 06.34.99.45.18
>>>> Mail : d.durieux@siprossii.com
>>>> Site Web : http://www.siprossii.com/
>>>>
>>>> SIPROSSII
>>>> 847 route de Frans (Cr=E9acit=E9)
>>>> 69400 Villefranche sur Sa=F4ne
>>>>
>>>>
>>>>
>>>> Le Wed, 3 Sep 2008 20:51:49 +0200
>>>> "Evert Lammerts" a =E9crit:
>>>>
>>>>>But the DELETE is executed? If it is, and it's in the condition,
>>>>>like in the above code:
>>>>>
>>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>>> .... DELETE ...
>>>>>}
>>>>>
>>>>>something apparently is fetched....
>>>>>
>>>>>On Wed, Sep 3, 2008 at 8:49 PM, David DURIEUX
>>>>> wrote:
>>>>>> Bonjour,
>>>>>>
>>>>>> Yes I'm using this query.... and no row select
>>>>>>
>>>>>> Cordialement,
>>>>>>
>>>>>> David DURIEUX
>>>>>> Tel : 04.74.04.81.34
>>>>>> Port : 06.34.99.45.18
>>>>>> Mail : d.durieux@siprossii.com
>>>>>> Site Web : http://www.siprossii.com/
>>>>>>
>>>>>> SIPROSSII
>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>
>>>>>>
>>>>>>
>>>>>> Le Wed, 3 Sep 2008 20:43:25 +0200
>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>
>>>>>>>Are you still using the code we talked about?
>>>>>>>
>>>>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>>>>> var_dump ($row);
>>>>>>> mysql_query("DELETE FROM table WHERE id=3D{$row['id']}")
>>>>>>> or
>>>>>>>die("delete error: " . mysql_error());
>>>>>>>}
>>>>>>>
>>>>>>>if so, apparently it does fetch a row. Otherwise, can you send
>>>>>>>the code you're using?
>>>>>>>
>>>>>>>On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>>>>>>> wrote:
>>>>>>>> Bonjour,
>>>>>>>>
>>>>>>>> I have always the problem, select =3D 0 rows and it delete it
>>>>>>>> like if delete is before the select :/
>>>>>>>>
>>>>>>>> Cordialement,
>>>>>>>>
>>>>>>>> David DURIEUX
>>>>>>>> Tel : 04.74.04.81.34
>>>>>>>> Port : 06.34.99.45.18
>>>>>>>> Mail : d.durieux@siprossii.com
>>>>>>>> Site Web : http://www.siprossii.com/
>>>>>>>>
>>>>>>>> SIPROSSII
>>>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Le Wed, 3 Sep 2008 20:05:22 +0200
>>>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>>>
>>>>>>>>>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>>>>>>>> wrote:
>>>>>>>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy
>>>>>>>>>> wrote:
>>>>>>>>>>> When using mysql_query, the SQL string to be executed should
>>>>>>>>>>> not end in a semicolon.
>>>>>>>>>>
>>>>>>>>>> Ending a query with a semicolon should not be a problem - the
>>>>>>>>>> string is parsed by the mysql server, which handles it fine.
>>>>>>>>>
>>>>>>>>>The manual does mention it, I'm a little too quick with my
>>>>>>>>>replies. I personally never had a problem with it though. Plus,
>>>>>>>>>it seemed to work some mails ago.
>>>>>>>>>
>>>>>>>>>David, did I understand well that your problem is solved?
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have make this to have a button, it's an error, it's the first time I
have a problem with this.
I'm sorry to have get your time.
Cordialement,
David DURIEUX
Tel : 04.74.04.81.34
Port : 06.34.99.45.18
Mail : d.durieux@siprossii.com
Site Web : http://www.siprossii.com/
SIPROSSII
847 route de Frans (Cr=E9acit=E9)
69400 Villefranche sur Sa=F4ne
Le Wed, 3 Sep 2008 21:56:56 +0200
"Evert Lammerts" a =E9crit:
>an anchor around a submit button...........?? I'm amazed that
>works!! :-)
>
>A real link doesn't make a difference?
>
>
>
>[Make sure to replace 139 with an existing id...]
>
>On Wed, Sep 3, 2008 at 9:50 PM, David DURIEUX
> wrote:
>> Bonjour,
>>
>> Humm if I go on page index.php?deleteid=3D139
>> it works
>>
>> If I click on the link
>> type=3D"submit" value=3D"Supprimer" style=3D"width: 100px; " />
>> I have the SELECT problem
>>
>> I will be crazy
>>
>> Cordialement,
>>
>> David DURIEUX
>> Tel : 04.74.04.81.34
>> Port : 06.34.99.45.18
>> Mail : d.durieux@siprossii.com
>> Site Web : http://www.siprossii.com/
>>
>> SIPROSSII
>> 847 route de Frans (Cr=E9acit=E9)
>> 69400 Villefranche sur Sa=F4ne
>>
>>
>>
>> Le Wed, 3 Sep 2008 21:08:25 +0200
>> David DURIEUX a =E9crit:
>>
>>>Bonjour,
>>>
>>>It was difficult, I have many files in includes, I will try to
>>>execute this code before in the php execution to see what code give
>>>problem.
>>>
>>>I try this now and I tell you the results of investigations
>>>
>>>
>>>Cordialement,
>>>
>>>David DURIEUX
>>>Tel : 04.74.04.81.34
>>>Port : 06.34.99.45.18
>>>Mail : d.durieux@siprossii.com
>>>Site Web : http://www.siprossii.com/
>>>
>>>SIPROSSII
>>>847 route de Frans (Cr=E9acit=E9)
>>>69400 Villefranche sur Sa=F4ne
>>>
>>>
>>>
>>>Le Wed, 3 Sep 2008 21:01:14 +0200
>>>"Evert Lammerts" a =E9crit:
>>>
>>>>This is weird. Can you send over the complete file?
>>>>
>>>>On Wed, Sep 3, 2008 at 8:56 PM, David DURIEUX
>>>> wrote:
>>>>> Bonjour,
>>>>>
>>>>> Yes DELETE is executed and I have on my page :
>>>>> string(3) "140"
>>>>> int(0)
>>>>>
>>>>> Cordialement,
>>>>>
>>>>> David DURIEUX
>>>>> Tel : 04.74.04.81.34
>>>>> Port : 06.34.99.45.18
>>>>> Mail : d.durieux@siprossii.com
>>>>> Site Web : http://www.siprossii.com/
>>>>>
>>>>> SIPROSSII
>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>
>>>>>
>>>>>
>>>>> Le Wed, 3 Sep 2008 20:51:49 +0200
>>>>> "Evert Lammerts" a =E9crit:
>>>>>
>>>>>>But the DELETE is executed? If it is, and it's in the condition,
>>>>>>like in the above code:
>>>>>>
>>>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>>>> .... DELETE ...
>>>>>>}
>>>>>>
>>>>>>something apparently is fetched....
>>>>>>
>>>>>>On Wed, Sep 3, 2008 at 8:49 PM, David DURIEUX
>>>>>> wrote:
>>>>>>> Bonjour,
>>>>>>>
>>>>>>> Yes I'm using this query.... and no row select
>>>>>>>
>>>>>>> Cordialement,
>>>>>>>
>>>>>>> David DURIEUX
>>>>>>> Tel : 04.74.04.81.34
>>>>>>> Port : 06.34.99.45.18
>>>>>>> Mail : d.durieux@siprossii.com
>>>>>>> Site Web : http://www.siprossii.com/
>>>>>>>
>>>>>>> SIPROSSII
>>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Le Wed, 3 Sep 2008 20:43:25 +0200
>>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>>
>>>>>>>>Are you still using the code we talked about?
>>>>>>>>
>>>>>>>>if ($row =3D mysql_fetch_assoc($query)) {
>>>>>>>> var_dump ($row);
>>>>>>>> mysql_query("DELETE FROM table WHERE
>>>>>>>> id=3D{$row['id']}") or
>>>>>>>>die("delete error: " . mysql_error());
>>>>>>>>}
>>>>>>>>
>>>>>>>>if so, apparently it does fetch a row. Otherwise, can you send
>>>>>>>>the code you're using?
>>>>>>>>
>>>>>>>>On Wed, Sep 3, 2008 at 8:35 PM, David DURIEUX
>>>>>>>> wrote:
>>>>>>>>> Bonjour,
>>>>>>>>>
>>>>>>>>> I have always the problem, select =3D 0 rows and it delete it
>>>>>>>>> like if delete is before the select :/
>>>>>>>>>
>>>>>>>>> Cordialement,
>>>>>>>>>
>>>>>>>>> David DURIEUX
>>>>>>>>> Tel : 04.74.04.81.34
>>>>>>>>> Port : 06.34.99.45.18
>>>>>>>>> Mail : d.durieux@siprossii.com
>>>>>>>>> Site Web : http://www.siprossii.com/
>>>>>>>>>
>>>>>>>>> SIPROSSII
>>>>>>>>> 847 route de Frans (Cr=E9acit=E9)
>>>>>>>>> 69400 Villefranche sur Sa=F4ne
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Le Wed, 3 Sep 2008 20:05:22 +0200
>>>>>>>>> "Evert Lammerts" a =E9crit:
>>>>>>>>>
>>>>>>>>>>On Wed, Sep 3, 2008 at 7:58 PM, Evert Lammerts
>>>>>>>>>> wrote:
>>>>>>>>>>> On Wed, Sep 3, 2008 at 7:41 PM, Dee Ayy
>>>>>>>>>>> wrote:
>>>>>>>>>>>> When using mysql_query, the SQL string to be executed
>>>>>>>>>>>> should not end in a semicolon.
>>>>>>>>>>>
>>>>>>>>>>> Ending a query with a semicolon should not be a problem -
>>>>>>>>>>> the string is parsed by the mysql server, which handles it
>>>>>>>>>>> fine.
>>>>>>>>>>
>>>>>>>>>>The manual does mention it, I'm a little too quick with my
>>>>>>>>>>replies. I personally never had a problem with it though.
>>>>>>>>>>Plus, it seemed to work some mails ago.
>>>>>>>>>>
>>>>>>>>>>David, did I understand well that your problem is solved?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php